package com.aw.guiguzi.util;

import com.aw.baselib.util.AwSpUtil;
import com.aw.guiguzi.constants.MyConstant;
import com.aw.guiguzi.enums.NumBettingEnums;

public class AppCacheUtil {

    private static final String COMMON_XML_NAME = "xml_local_config";

    /**
     * 获取是否首次使用APP
     */
    public static boolean isFirstUseApp() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "FirstUseApp", true);
    }

    /**
     * 设置是否首次使用APP
     */
    public static void setFirstUseApp(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "FirstUseApp", param);
    }

    /**
     * 设置下注配置---数量(每个箱子)
     * @param param
     */
    public static void setBettingConfigCount(String param) {
        AwSpUtil.saveString(COMMON_XML_NAME, "NumBettingConfigCount", param);
    }

    /**
     * 获取下注配置---数量(每个箱子)
     */
    public static String getBettingConfigCount() {
        return AwSpUtil.getString(COMMON_XML_NAME, "NumBettingConfigCount", NumBettingEnums.MODE_1_1_10.getDesc());
    }

    /**
     * 设置下注配置---组合
     * @param param
     */
    public static void setBettingConfigBlock(String param) {
        AwSpUtil.saveString(COMMON_XML_NAME, "NumBettingConfigBlock", param);
    }

    /**
     * 获取下注配置---组合
     */
    public static String getBettingConfigBlock() {
        return AwSpUtil.getString(COMMON_XML_NAME, "NumBettingConfigBlock", "小");
    }

    /**
     * 设置下注配置数量---银(所有箱子)
     * @param param
     */
    public static void setBettingConfigInputSliver(String param, boolean isTotal) {
        if(isTotal) {
            AwSpUtil.saveString(COMMON_XML_NAME, "NumBettingConfigInputSliverTotal", param);
        } else {
            AwSpUtil.saveString(COMMON_XML_NAME, "NumBettingConfigInputSliver", param);
        }

    }

    /**
     * 获取下注配置数量---银(所有箱子)
     */
    public static String getBettingConfigInputSliver(boolean isTotal) {
        if(isTotal) {
            return AwSpUtil.getString(COMMON_XML_NAME, "NumBettingConfigInputSliverTotal", "");
        } else {
            return AwSpUtil.getString(COMMON_XML_NAME, "NumBettingConfigInputSliver", "");
        }
    }

    /**
     * 设置下注配置数量---硬皮(所有箱子)
     * @param param
     */
    public static void setBettingConfigInputSkin(String param, boolean isTotal) {
        if(isTotal) {
            AwSpUtil.saveString(COMMON_XML_NAME, "NumBettingConfigInputSkinTotal", param);
        } else {
            AwSpUtil.saveString(COMMON_XML_NAME, "NumBettingConfigInputSkin", param);
        }
    }

    /**
     * 获取下注配置数量---硬皮(所有箱子)
     */
    public static String getBettingConfigInputSkin(boolean isTotal) {
        if(isTotal) {
            return AwSpUtil.getString(COMMON_XML_NAME, "NumBettingConfigInputSkinTotal", "");
        } else {
            return AwSpUtil.getString(COMMON_XML_NAME, "NumBettingConfigInputSkin", "");
        }
    }

    /**
     * 设置下注配置数量---宝石(所有箱子)
     * @param param
     */
    public static void setBettingConfigInputGemstone(String param, boolean isTotal) {
        if(isTotal) {
            AwSpUtil.saveString(COMMON_XML_NAME, "NumBettingConfigInputGemstoneTotal", param);
        } else {
            AwSpUtil.saveString(COMMON_XML_NAME, "NumBettingConfigInputGemstone", param);
        }
    }

    /**
     * 获取下注配置数量---宝石(所有箱子)
     */
    public static String getBettingConfigInputGemstone(boolean isTotal) {
        if(isTotal) {
            return AwSpUtil.getString(COMMON_XML_NAME, "NumBettingConfigInputGemstoneTotal", "");
        } else {
            return AwSpUtil.getString(COMMON_XML_NAME, "NumBettingConfigInputGemstone", "");
        }
    }

    /**
     * 设置下注配置数量---5倍区是否翻倍
     */
    public static void setBettingConfigDouble5(boolean isDouble) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "NumBettingConfigInputDouble5", isDouble);
    }

    /**
     * 获取下注配置数量---5倍区是否翻倍
     */
    public static boolean isBettingConfigDouble5() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "NumBettingConfigInputDouble5", false);
    }

    /**
     * 设置下注配置数量---2倍区是否翻倍
     */
    public static void setBettingConfigDouble2(boolean isDouble) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "NumBettingConfigInputDouble2", isDouble);
    }

    /**
     * 获取下注配置数量---2倍区是否翻倍
     */
    public static boolean isBettingConfigDouble2() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "NumBettingConfigInputDouble2", false);
    }


    /**
     * 设置下注配置数量---2.5倍区是否翻倍
     */
    public static void setBettingConfigDouble2Half5(boolean isDouble) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "NumBettingConfigInputDouble2Half5", isDouble);
    }

    /**
     * 获取下注配置数量---2.5倍区是否翻倍
     */
    public static boolean getBettingConfigDouble2Half5() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "NumBettingConfigInputDouble2Half5", false);
    }

    /**
     * 设置是否显示投注计算区
     */
    public static void setShowBettingCalArea(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "ShowBettingCalArea", param);
    }


    /**
     * 获取是否显示投注计算区
     */
    public static boolean isShowBettingCalArea() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "ShowBettingCalArea", true);
    }

    /**
     * 设置是否启用手输下注方式
     */
    public static void setHandleInputBetting(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "HandleInputBetting", param);
    }


    /**
     * 获取是否启用手输下注方式
     */
    public static boolean isHandleInputBetting() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "HandleInputBetting", false);
    }

    /**
     * 获取是否自动过滤自定义走势（分析后自动隐藏其他非建议的走势）
     */
    public static boolean isTrendsAutoFilter() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "TrendsAutoFilter", false);
    }

    /**
     * 设置是否自动过滤自定义走势（分析后自动隐藏其他非建议的走势）
     */
    public static void setTrendsAutoFilter(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "TrendsAutoFilter", param);
    }


    /**
     * 获取是否展示通用走势建议类型
     */
    public static boolean isCommonSuggest() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "CommonSuggest", false);
    }

    /**
     * 设置是否展示通用走势建议类型
     */
    public static void setCommonSuggest(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "CommonSuggest", param);
    }


    /**
     * 获取是否显示单压模拟投注入口
     */
    public static boolean isShowBettingImitate() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "ShowBettingImitate", false);
    }

    /**
     * 设置是否显示单压模拟投注入口
     */
    public static void setShowBettingImitate(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "ShowBettingImitate", param);
    }

    /**
     * 获取展示的长度类型
     */
    public static int getLimitType() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "LimitType", MyConstant.SWITCH_ALL);
    }

    /**
     * 设置展示的长度
     */
    public static void setLimitType(int param) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "LimitType", param);
    }

    /**
     * 获取是否筛除前固定长度数字各种统计
     */
    public static boolean isNumsScreenOutPre() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "NumsScreenOut15Pre", false);
    }

    /**
     * 设置是否筛除前固定长度数字各种统计
     */
    public static void setNumsScreenOutPre(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "NumsScreenOut15Pre", param);
    }

    /**
     * 获取是否展示通用走势分析
     */
    public static boolean isCommonAnalysis() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "CommonAnalysis", true);
    }

    /**
     * 设置是否展示组合分析
     */
    public static void setCombinationAnalysis(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "CombinationAnalysis", param);
    }

    /**
     * 获取是否展示组合分析
     */
    public static boolean isCombinationAnalysis() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "CombinationAnalysis", true);
    }

    /**
     * 设置是否展示通用走势分析
     */
    public static void setCommonAnalysis(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "CommonAnalysis", param);
    }

    /**
     * 获取是否展示多种跳变走势分析
     */
    public static boolean isJumpSmoothly() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "JumpSmoothly", false);
    }

    /**
     * 设置是否展示多种跳变走势分析
     */
    public static void setJumpSmoothly(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "JumpSmoothly", param);
    }

    /**
     * 设置是否显示各走势类型数量统计(最大值）
     */
    public static void setStatisticsCountMax(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "StatisticsCountMax", param);
    }

    /**
     * 获取是否显示各走势类型数量统计(最大值）
     */
    public static boolean isStatisticsCountMax() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "StatisticsCountMax", true);
    }


    /**
     * 设置是否使用分析模式2
     */
    public static void setAnalaysisModel2(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "AnalaysisModel2", param);
    }

    /**
     * 获取是否使用分析模式2(默认使用分析模式1）
     */
    public static boolean isAnalaysisModel2() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "AnalaysisModel2", false);
    }

    /**
     * 设置是否显示各走势类型数量统计
     */
    public static void setStatisticsCount(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "StatisticsCount", param);
    }

    /**
     * 获取是否显示各走势类型数量统计
     */
    public static boolean isStatisticsCount() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "StatisticsCount", true);
    }

    /**
     * 获取是否启用结果数字选取提示
     */
    public static boolean isResultNumCheckHint() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "ResultNumCheckHint", true);
    }

    /**
     * 设置是否启用结果数字选取提示
     */
    public static void setResultNumCheckHint(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "ResultNumCheckHint", param);
    }

    /**
     * 获取是否启用自动填充提示
     */
    public static boolean isAutoFillHint() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "AutoFillHint", true);
    }

    /**
     * 设置是否启用自动填充提示
     */
    public static void setAutoFillHint(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "AutoFillHint", param);
    }


    /**
     * 保存最后的所有面板数据， 重新打开app时用于提醒
     * @param nums
     */
    public static void setLastNums(String nums) {
        AwSpUtil.saveString(COMMON_XML_NAME, "LastNums", nums);
    }

    /**
     * 获取最后所有的面板数据
     * @return
     */
    public static String getLastNums() {
        return AwSpUtil.getString(COMMON_XML_NAME, "LastNums", "");
    }

    /**
     * 获取是否显示功能帮助提示
     */
    public static boolean isFunHelpHint() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "FunHelpHint", false);
    }

    /**
     * 设置是否显示功能帮助提示
     */
    public static void setFunHelpHint(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "FunHelpHint", param);
    }

    /**
     * 获取是否自动下注已选择组合
     */
    public static boolean isBettingDefault() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "BettingDefault", true);
    }

    /**
     * 设置是否自动下注已选择组合
     */
    public static void setBettingDefault(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "BettingDefault", param);
    }

    /**
     * 获取是否下注提交后再次弹框提示
     */
    public static boolean isBettingReConfirm() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "BettingReConfirm", true);
    }

    /**
     * 设置是否下注提交后再次弹框提示
     */
    public static void setBettingReConfirm(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "BettingReConfirm", param);
    }

    /**
     * 保存投注自定义配置数量
     */
    public static void setBettingCustom(String configNums) {
        AwSpUtil.saveString(COMMON_XML_NAME, "BettingCustom", configNums);
    }

    /**
     * 获取投注自定义配置数量
     * @return
     */
    public static String getBettingCustom() {
        return AwSpUtil.getString(COMMON_XML_NAME, "BettingCustom", "10/10/200");
    }

    /**
     * 保存自定义设置筛除的数字长度
     */
    public static void setAnalysisNumsScreenOutPreCustom(int configNums) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "AnalysisNumsScreenOutPreCustom", configNums);
    }

    /**
     * 获取自定义设置筛除的数字长度
     * @return
     */
    public static int getAnalysisNumsScreenOutPreCustom() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "AnalysisNumsScreenOutPreCustom", 15);
    }

    /**
     * 保存自定义分析最低数字长度
     */
    public static void setAnalysisLengthCustom(int configNums) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "AnalysisLengthCustom", configNums);
    }

    /**
     * 获取自定义分析最低数字长度
     * @return
     */
    public static int getAnalysisLengthCustom() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "AnalysisLengthCustom", 15);
    }

    /**
     * 保存自定义限制统计数量
     */
    public static void setLimitStatisticsCountCustom(int configNums) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "LimitStatisticsCountCustom", configNums);
    }

    /**
     * 获取自定义限制统计数量
     * @return
     */
    public static int getLimitStatisticsCountCustom() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "LimitStatisticsCountCustom", 15);
    }

    /**
     * 保存自定义走势分析比值(限制统计长度下）
     */
    public static void setCalLengthDifferenceLimitStatistics(int param) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "CalLengthDifferenceLimitStatistics", param);
    }

    /**
     * 获取自定义走势分析比值(限制统计长度下）
     * @return
     */
    public static int getCalLengthDifferenceLimitStatistics() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "CalLengthDifferenceLimitStatistics", 4);
    }

    /**
     * 保存末尾连续长度
     */
    public static void setCalEndLength(int param) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "CalEndLength", param);
    }

    /**
     * 获取末尾连续长度
     * @return
     */
    public static int getCalEndLength() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "CalEndLength", 4);
    }

    /**
     * 保存自定义走势分析比值(限制分析长度)
     */
    public static void setCalLengthDifferenceLimitAnalaysis(int param) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "CalLengthDifferenceLimitAnalaysis", param);
    }

    /**
     * 获取自定义走势分析比值(限制分析长度)
     * @return
     */
    public static int getCalLengthDifferenceLimitAnalaysis() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "CalLengthDifferenceLimitAnalaysis", 8);
    }

    /**
     * 保存自定义走势分析比值(所有数)
     */
    public static void setCalLengthDifferenceAll(int param) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "CalLengthDifferenceAll", param);
    }

    /**
     * 获取自定义走势分析比值(所有数)
     * @return
     */
    public static int getCalLengthDifferenceAll() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "CalLengthDifferenceAll", 8);
    }

    /**
     * 保存自定义走势分析比值(筛除前15)
     */
    public static void setCalLengthDifferencePre15(int param) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "CalLengthDifferencePre15", param);
    }

    /**
     * 获取自定义走势分析比值(筛除前15)
     * @return
     */
    public static int getCalLengthDifferencePre15() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "CalLengthDifferencePre15", 8);
    }


    /**
     * 设置指定走势是否启用
     */
    public static void setTrendActive(String trendTag, boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "TrendActive" + trendTag, param);
    }

    /**
     * 获取指定走势是否启用
     */
    public static boolean isTrendActive(String trendTag) {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "TrendActive" + trendTag, true);
    }

    /**
     * 设置是否限定分析最后 自定义配置 位数
     */
    public static void setLimitLastCustomLength(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "LimitLastCustomLength", param);
    }

    /**
     * 获取是否限定分析最后 自定义配置 位数
     */
    public static boolean isLimitLastCustomLength() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "LimitLastCustomLength", false);
    }

    /**
     * 设置是否展示分析区部分快捷开关
     */
    public static void setAnalysisQuick(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "AnalysisQuick", param);
    }

    /**
     * 获取是否展示分析区部分快捷开关
     */
    public static boolean isAnalysisQuick() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "AnalysisQuick", true);
    }


    /**
     * 设置冷热号（面板）开关
     */
    public static void setColdAndHotDefault(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "ColdAndHotDefault", param);
    }

    /**
     * 获取冷热号（面板）开关
     */
    public static boolean isColdAndHotDefault() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "ColdAndHotDefault", true);
    }

    /**
     * 设置冷热号（区域）开关
     */
    public static void setColdAndHotCustom(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "ColdAndHotCustom", param);
    }

    /**
     * 获取冷热号（区域）开关
     */
    public static boolean isColdAndHotCustom() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "ColdAndHotCustom", true);
    }


    /**
     * 设置热号（详细展示）开关
     */
    public static void setHotShowModelDetail(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "HotShowModelDetail", param);
    }

    /**
     * 获取热号（详细展示）开关
     */
    public static boolean isHotShowModelDetail() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "HotShowModelDetail", true);
    }

    /**
     * 设置缓存交易数据
     */
    public static void setTransactionFileUrl(String param) {
        AwSpUtil.saveString(COMMON_XML_NAME, "TransactionFileUrl", param);
    }

    /**
     * 获取缓存交易数据
     */
    public static String getTransactionFileUrl() {
        return AwSpUtil.getString(COMMON_XML_NAME, "TransactionFileUrl", "");
    }


    /**
     * 设置缓存计算间隔位数(默认2位数, 即单押7个数字)
     */
    public static void setCalIntervalNum(int param) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "CalIntervalNum", param);
    }

    /**
     * 获取缓存计算间隔位数(默认2位数, 即单押5个数字)
     */
    public static int getCalIntervalNum() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "CalIntervalNum", 2);
    }


    /**
     * 保存数量多的比重 百分比
     */
    public static void setBetterTrendsPercent(int param) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "BetterTrendsPercent", param);
    }

    /**
     * 获取数量多的比重 百分比
     * @return
     */
    public static int getBetterTrendsPercent() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "BetterTrendsPercent", 50);
    }

    /**
     * 设置比重择优开关
     */
    public static void setUseBetterTrendsPercent(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "UseBetterTrendsPercent", param);
    }

    /**
     * 获取走势分类百分比开关
     */
    public static boolean isUseTypePercent() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "UseTypePercent", true);
    }

    /**
     * 设置走势分类百分比开关
     */
    public static void setUseTypePercent(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "UseTypePercent", param);
    }

    /**
     * 获取比重择优开关
     */
    public static boolean isUseBetterTrendsPercent() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "UseBetterTrendsPercent", true);
    }


    /**
     * 设置交易配置 是否允许动态新增
     */
    public static void setTransactionConfigAdd(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "TransactionConfigAdd", param);
    }

    /**
     * 获取交易配置 是否允许动态新增
     */
    public static boolean isTransactionConfigAdd() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "TransactionConfigAdd", true);
    }

    /**
     * 设置交易配置 是否允许动态删除
     */
    public static void setTransactionConfigDel(boolean param) {
        AwSpUtil.saveBoolean(COMMON_XML_NAME, "TransactionConfigDel", param);
    }

    /**
     * 获取交易配置 是否允许动态删除
     */
    public static boolean isTransactionConfigDel() {
        return AwSpUtil.getBoolean(COMMON_XML_NAME, "TransactionConfigDel", true);
    }

    /**
     * 保存网格图片展示  单排图片数量
     */
    public static void setGridImgNums(int param) {
        AwSpUtil.saveInt(COMMON_XML_NAME, "GridImgNums", param);
    }

    /**
     * 获取网格图片展示  单排图片数量
     * @return
     */
    public static int getGridImgNums() {
        return AwSpUtil.getInt(COMMON_XML_NAME, "GridImgNums", 3);
    }

}
